package everyday;

/**
 * @Author: Siantar
 * @Date: 2023-06-29-21:40
 * @Description: 1.0
 */
public class T1401 {
    public boolean checkOverlap(int radius, int xCenter, int yCenter, int x1, int y1, int x2, int y2) {
        double d = 0;
        if (xCenter < x1 || xCenter > x2) {
            d += Math.min(Math.pow(x1 - xCenter, 2), Math.pow(x2 - xCenter, 2));
        }
        if (yCenter < y1 || yCenter > y2) {
            d += Math.min(Math.pow(y1 - yCenter, 2), Math.pow(y2 - yCenter, 2));
        }
        return d <= radius * radius;
    }
}
